<?php
include_once 'MY/extra_sql.php';
class SystemController extends Zend_Controller_Action{
	function init(){
		if($_SESSION['user']==""){
			echo "<script>window.location='../user/login';</script>"; exit;
		}
		$this->registry = Zend_Registry::getInstance();
		$this->view = $this->registry['view'];
		$this->view->baseUrl = $this->_request->getBaseUrl();
		$this->view->template = "system";

		$group_id = $_SESSION['user']['group_id'];
		$group = new Group();
		$group = $group->getgroupByid($group_id);
		$groups = explode(',',$group[0]['models']);
		if(!in_array('system',$groups)){
			echo "<script>alert('No Permission To Enter!');history.go('-1');</script>";exit();
		}
		
	}

	public function indexAction(){
		echo $this->view->render('system/index.html');

	}
}
?>
